package com.nlp.utils;

import java.util.concurrent.ConcurrentMap;

public class SummaryTask implements Runnable {

	ConcurrentMap<String, String> concurrentMap;
	private String action;
	private String query;
	private String language;
	private String region;
	private String secretkid;
	private String timestamp;
	private String version;
	private String secretkey;
	private String partId;
	private String itemId;

	

	public SummaryTask(ConcurrentMap<String, String> concurrentMap, String action, String query, String language,
			String region, String secretkid, String timestamp, String version, String secretkey, String partId,
			String itemId) {
		super();
		this.concurrentMap = concurrentMap;
		this.action = action;
		this.query = query;
		this.language = language;
		this.region = region;
		this.secretkid = secretkid;
		this.timestamp = timestamp;
		this.version = version;
		this.secretkey = secretkey;
		this.partId = partId;
		this.itemId = itemId;
	}


	public void run() {
		try {
			String res = SummaryUtils.getSummary(action, query, language, region, 
					secretkid,timestamp, version, secretkey,"10");
			concurrentMap.put(partId + "|" + itemId, res);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
